﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DynaPrecision.FastFourierTransform
{
	public class Chebyshev2ndDerivativeMatrix<T> : LinearSystem.IMultiDimensionalArray<T>
	{
		public int Rank { get; set; }
		#region IMultiDimensionalArray<T> Members

		public T this[params int[] index]
		{
			get
			{
				if ((index[1] - index[0] < 2) || (index[1] - index[0]) % 2 == 1)
				{
					return DefaultValueProvider<T>.Zero;
				}
				else
				{
					if (index[0] == 0) return (T)((dynamic)index[1] * ((double)(index[1] - index[0])) / 2 * ((double)(index[1] + index[0])));
					else return (T)((dynamic)index[1] * ((double)(index[1] - index[0])) * ((double)(index[1] + index[0])));
				}
			}
			set
			{
				throw new NotSupportedException();
			}
		}

		public int GetLength(int DimensinNumber)
		{
			return Rank + 1;
		}

		public int Dimension
		{
			get { return 2; }
		}

		#endregion
	}
}
